package com.itheima.fanfa;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author zhangbaiyan
 * @date 2024-09-17 15:55
 * @description:
 * @version:
 */
public class test2 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"张无忌,15","周紫若,16","赵敏,17","张强,18","张三分,19","张翠山,20","张良,21","王二礣,222");
//        list.stream().map( s-> new Student(s.split(",")[0], Integer.parseInt(s.split(",")[1]))).forEach(System.out::println);
        List<Student> collect = list.stream().map(Student::new).collect(Collectors.toList());
        System.out.println(collect);

    }
}
